package com.dingwen.stusprboomon.entity.page;


import lombok.AllArgsConstructor;
import lombok.Builder;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

/**
 * mongo 分页对象
 *
 * @author dingwen
 * 2021.06.24 14:53
 */
@AllArgsConstructor
@Builder
public class MongoPageable implements Pageable {

    private final Integer pageNum;
    private final Integer pagSize;
    private final Sort sort;

    @Override
    public int getPageNumber() {
        return this.pageNum;
    }

    @Override
    public int getPageSize() {
        return this.pagSize;
    }

    @Override
    public long getOffset() {
        return (this.pageNum - 1) * this.pagSize;
    }

    @Override
    public Sort getSort() {
        return this.sort;
    }

    @Override
    public Pageable next() {
        return null;
    }

    @Override
    public Pageable previousOrFirst() {
        return null;
    }

    @Override
    public Pageable first() {
        return null;
    }

    @Override
    public Pageable withPage(int i) {
        return null;
    }

    @Override
    public boolean hasPrevious() {
        return false;
    }
}
